package com.cn.wangxin.service.user.impl;

import com.cn.wangxin.dao.user.UserMapper;
import com.cn.wangxin.service.user.DisplayService;
import com.cn.wangxin.domain.user.User;

import javax.annotation.Resource;
import java.util.Random;

/**
 * Created by jing on 16/9/15.
 */
public class DisplayServiceImpl implements DisplayService {
    @Resource
    private UserMapper userMapper;
    public String getHelloWorld() {
        return "Hello World, Spring 3.0!";
    }

    public int getRandomNumber() {
        Random random = new Random();
        return random.nextInt(100);
    }


    public User getUser() throws Exception{
        User user = new User();
        user.setUsername("222");
        user = userMapper.selectLogin(user);
        return user;
    }
}
